package com.gxa.domain.dto;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.NotBlank;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

@Data
@ApiModel(value = "系统用户添加实体")
public class SysUserSaveDTO implements Serializable {

    @ApiModelProperty(name = "realName",notes = "真实姓名",dataType = "String",required = true)
    @NotBlank(message = "真实姓名不能为空")
    @Size(min = 2, message = "真实姓名：请输入至少2个字符")
    private String realName;

    @ApiModelProperty(name = "mobile",notes = "手机号码",dataType = "String",required = true)
    @NotBlank(message = "登录手机号码不能为空")
    @Pattern(regexp = "^1\\d{10}$",message = "手机号码格式不正确")
    private String mobile;

    @ApiModelProperty(name = "deptId",notes = "所属部门",dataType = "String",required = true)
    @NotNull(message = "所属部门")
    private Integer deptId;//所属部门

    @ApiModelProperty(name = "sex",notes = "性别",dataType = "String",required = true)
    @NotNull(message = "性别")
    @Range(min = 1,max = 2,message = "状态(1:男,2:女)")
    private Byte sex; //性别（1:男,2:女）

    @ApiModelProperty(name = "email",notes = "邮箱",dataType = "String",required = false)
    @Pattern(regexp = "^\\w+([-+.]\\w+)*@\\w+([-.]\\w+)*\\.\\w+([-.]\\w+)*$",message = "邮箱格式不正确")
    private String email; //邮箱


    @ApiModelProperty(name = "majorId",notes = "所属方向",dataType = "String",required = false)
    private Integer majorId;//所属方向


}
